<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php

class FileStar extends CMiniyunModel
{
    
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

    
    public function tableName()
    {
        return Yii::app()->params['tablePrefix'].'file_star';
    }

	public function findByUseridAndFileid($user_id, $file_id){
		$data =  UserFile::model()->findAllBySql("select * from ".Yii::app()->params['tablePrefix']."file_star where user_id=".$user_id." and file_id=".$file_id);
		return $data;
	}
	
	
    public function deleteAllByFileIds($userId, $fileIds) {
        return $this->deleteAll(array('condition' => "user_id=:user_id and file_id in ({$fileIds})",
                               'params'    => array(':user_id'=>$userId)));
    }
	
}